| Total Complexity | 4 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import JsonRequestAdapter from "./Adapter/JsonRequestAdapter"; |
||
| 6 | |||
| 7 | class ConnectionAdapterFactory { |
||
| 8 | static getAdapter (name: string, connectionSettings: ConnectionSettings): AdapterInterface { |
||
| 9 | if (name === 'jsonRequest') { |
||
| 10 | return new JsonRequestAdapter(connectionSettings); |
||
| 11 | } |
||
| 12 | |||
| 13 | if (name === 'localStorage') { |
||
| 14 | return new LocalStorageAdapter(connectionSettings); |
||
| 15 | } |
||
| 16 | |||
| 17 | if (name === 'localArray') { |
||
| 18 | return new LocalArrayAdapter(connectionSettings); |
||
| 19 | } |
||
| 20 | |||
| 21 | return new JsonRequestAdapter(connectionSettings); |
||
| 22 | } |
||
| 30 | } |